package com.utils;

import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

public class JedisResource {

    public static JedisPool getResource() {
        JedisPoolConfig config = new JedisPoolConfig();
        config.setMaxTotal(20480);
        config.setMaxIdle(200);
        config.setMaxWaitMillis(2000);
        config.setTestOnBorrow(true);
        config.setTestOnReturn(true);
        String Host = "127.0.0.1";
        Integer Port = 6379;
        Integer TimeOut = 10000;
        JedisPool jedisPool = new JedisPool(config, Host, Port, TimeOut);
        return jedisPool;
    }
}
